package gui;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JPanel;

import random.MersenneTwisterFast;

/**
 * @author Kevin Wagner
 * @version
 */
public class WuselPanel extends JPanel implements WuselPanelInterface{

	/**
	 * 
	 */
	private static final long serialVersionUID = -901316524449163396L;
	private int number;
	
	/**
	 * Creates a new Wusel Panel with a given number of wusel.
	 * @param number
	 */
	public WuselPanel(int number){
		this.number=number;
	}
	
	
	public void paint(Graphics g){
		MersenneTwisterFast mt = new MersenneTwisterFast();
		for (int i = 0; i < number/4; i++) {
			int x = mt.nextInt(this.getWidth()-20);
			int y = mt.nextInt(this.getHeight()-30);
			Wusel.paint(g,Color.green, x, y);
		}
		for (int i = 0; i < number/4; i++) {
			int x = mt.nextInt(this.getWidth()-20);
			int y = mt.nextInt(this.getHeight()-30);
			Wusel.paint(g,Color.yellow, x, y);
		}
		for (int i = 0; i < number/4; i++) {
			int x = mt.nextInt(this.getWidth()-20);
			int y = mt.nextInt(this.getHeight()-30);
			Wusel.paint(g,Color.red, x, y);
		}
		for (int i = 0; i < number/4; i++) {
			int x = mt.nextInt(this.getWidth()-20);
			int y = mt.nextInt(this.getHeight()-30);
			Wusel.paint(g,Color.blue, x, y);
		}
	}


	@Override
	public boolean checkForChanges() {
		return false;
	}


	@Override
	public boolean saveData() {
		return true;
	}


	@Override
	public void updateLanguage() {
	}


	@Override
	public boolean confirmDialog() {
		return true;
	}

}
